﻿@using Vote.Models
@{
    ViewBag.Title = "Votes";
    Layout = null;
    ListVotesShowModel ListModel = ViewBag.Model;
    var Model = ListModel.VoteModel;
    var PlaceHolder = ViewBag.PlaceHolder;
    var VoteNumbers = ViewBag.VoteNumbers;
    var VoteNumberId = ViewBag.VoteNumberId;
    int page = ViewBag.page;
    double scrollNum = ViewBag.scrollNum;
    bool isSubscribe = ViewBag.isSubscribe;
}
<link href="@Url.Content("~/Content/common.css")" rel="stylesheet" type="text/css" />
<link href="@Url.Content("~/Content/demos.css")" rel="stylesheet" type="text/css" />
<link href="@Url.Content("~/Content/jquery-weui.css")" rel="stylesheet" type="text/css" />
<link href="@Url.Content("~/Content/weui.min.css")" rel="stylesheet" type="text/css" />
<script src="@Url.Content("~/Scripts/jquery-1.9.1.min.js")"></script>
<script src="@Url.Content("~/Scripts/fastclick.js")"></script>
<script src="@Url.Content("~/Scripts/jquery.lazyload.js")"></script>
<script src="@Url.Content("~/Scripts/lhgdialog/lhgdialog.min.js")"></script>
<script src="@Url.Content("~/Scripts/common.js")"></script>
<script src="@Url.Content("~/Scripts/swiper.js")"></script>
<!DOCTYPE html>
<html>
<head>
    <title>爱农人2017柳州“童心 同乐”六一少儿艺术展演</title>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no">

    <meta http-equiv="Expires" content="0">

    <meta http-equiv="Cache-Control" content="no-cache">

    <meta http-equiv="Pragma" content="no-cache">

    <script>
    var _hmt = _hmt || [];
    (function () {
        var hm = document.createElement("script");
        hm.src = "https://hm.baidu.com/hm.js?4fd648fda0a3af92d7a11dfd25b34442";
        var s = document.getElementsByTagName("script")[0];
        s.parentNode.insertBefore(hm, s);
    })();
    </script>
</head>


<style>
        body {background: url("@Url.Content("~/images/liu-bg_01.png")") no-repeat;background-size: cover; }
        .clckClass{background: rgb(4, 190, 2) !important;color: #fff !important;}
        .weui-btn{padding:0;}
        .weui-dialog__hd {padding:1.5rem 1rem;}
        .player-box{background:#a8e9ff;    padding-bottom:10rem !important;}
        .moren{display: block;background: #795dc3;width: 66%;text-align: center;color: #a8e9ff; height: 1.6rem;font-size: 72%; margin: 23% 17%;line-height: 1.6rem;border-radius: 3px;}
</style>

<body>
    <input type="hidden" value="@page" id="page" />
    <input type="hidden" value="@scrollNum" id="scrollNum" />
    <input type="hidden" value="@isSubscribe" id="isSubscribe" />
    <!--关注二维码弹框-->
    <div class="ewm">
        <div class="ewm-bg">
            <div class="ewm-box">
                <h3>第一步：长按二维码并关注</h3>
                <div class="ewm-img">
                    <img src="~/Content/img/gxanrQrCode.jpg">
                </div>
                <h3>第二步：进入公众号投票</h3>

                <div class="close">
                    取消
                </div>
            </div>
        </div>
    </div>

    <!--轮播-->
    <div class="swiper-box">
        <div class="swiper-container">
            <!-- Additional required wrapper -->
            <div class="swiper-wrapper">
                <!-- Slides -->
                <div class="swiper-slide"><a href="http://m.gxanr.com/Product/16800.html"><img src="@Url.Content("~/images/swiper-1.jpg")" /></a></div>
                <div class="swiper-slide"><a href="https://mp.weixin.qq.com/s/Hw5SH7jj8Q5JTQPJu81ogg"><img src="@Url.Content("~/images/swiper-2.jpg")" /></a></div>
                <div class="swiper-slide"><a href="http://m.gxanr.com"><img src="@Url.Content("~/images/swiper-3.jpg")" /></a></div>
            </div>
            <!-- If we need pagination -->
            <div class="swiper-pagination"></div>
        </div>
    </div>

    <!--分享弹框-->
    <div class="share-bg" style="width: 100%;height: 100%;position: fixed;top: 0;left: 0;z-index: 99999;background-color: rgba(51, 51, 51, .7);display: none;">
        <div class="share-box" style="padding: 0.7rem;">
            <img style="width: 100%;" src="@Url.Content("~/images/share.png")">
        </div>
    </div>

    @*<ul class="nav-box">
        <li><a class="moren clckClass" votenumberid="27">全部</a></li>
        @if (VoteNumbers != null)
        {
            foreach (var voteNu in VoteNumbers)
            {
                if (voteNu.Name == "第一场")
                {
                <li><a class="moren clckClass" votenumberid="@voteNu.Id">@voteNu.Name</a></li>                    
                }
                else
                {
                  <li><a class="moren" votenumberid="@voteNu.Id">@voteNu.Name</a></li>                  
                }
            }
        }
    </ul>*@

 

    <div class="search-box" style="top: 0; left: 0; background: #a8e9ff;width: 100%; z-index: 999; height: 3.4rem;">
        <input class="search-tip fl" id="FestivalName" type="text" onkeydown="serkeydown(this,event)" placeholder="请输入节目编号或名称">
        <a class="search-btn fr" onclick="return submitSearch('FestivalName');">搜索</a>
        <p style="clear:both;"></p>
        <!--投票余量-->
        <div class="VoteTime">
            <span class="VoteTime-text"><a id="changCi" style="color:red;font-size:0.7rem;"></a>投票时间<span class="VoteTime-Start" style="padding-left:0.3rem;">@ListModel.StartTime</span></span>
            <span class="VoteTime-text">~</span>
            <span class="VoteTime-text"><span class="VoteTime-End">@ListModel.EndTime</span>今天剩余<a id="remainVotes" style="color:red;font-size:0.7rem;">@ListModel.RemainVotes</a>票</span>
        </div>
    </div>
    @*}*@
    <!--搜索滚动-->
    <div class="footer-top">
        <img src="@Url.Content("~/images/footer-top.png")">
    </div>
   
    <script>
        //微信返回页面刷新
        $(function () {
            //电脑客户端打开弹出二维码
            var isPc = /macintosh|window/.test(navigator.userAgent.toLowerCase());
            if (isPc) {
                window.location.href = "/Home/ComputerCode";
            }
            var piaoShu = sessionStorage.getItem("VoteNumSession");
            var sessionId = sessionStorage.getItem("VoteNumSessionIds");
            var xxx = sessionStorage.getItem("need-refresh");
            //投票票数为零，跳转到微商城，再回来
            var sfdasdf = sessionStorage.getItem("LeaveVoteNum");
            if (sfdasdf!=null) {
                $("#remainVotes").text(sfdasdf);
                sessionStorage.removeItem("LeaveVoteNum");
            }
            if (parseInt(piaoShu) > 0) {
                $("#" + sessionId + "-bottom").text(piaoShu);
                $("#" + sessionId).addClass("weui-btn weui-btn_disabled weui-btn_default");
                sessionStorage.removeItem("VoteNumSession");
                sessionStorage.removeItem("VoteNumSessionIds");
            }
        });
        var searchtype = 0;
        $(window).scroll(function () {
            var scrollTop = $(window).scrollTop();
            if (scrollTop < 240) {
                $('.search-box').css({ position: 'relative' })
                /*
                $("#logo").css({
                    'display': "none",
                });
                */
            }
            if (scrollTop > 240) {
                $('.search-box').css(
                   { position: 'fixed' }
                    )
                /*
                $("#logo").css({
                    'display': "block",
                });
                */
            }
        });
    </script>
    <!--player选手列表-->
    <div class="player-box">
        <ul class="player" id="list">
            @if (Model != null)
            {
                int i=0;
                int pageTemp=0;
                foreach (VoteShowModel VotesShows in Model)
                {
                    i++;
                    if(i%6>0){
                        pageTemp = i / 6 + 1;
                    }
                    else
                    {
                        pageTemp = i / 6;
                    }

                    <li>
                        <div class=" player-list fl">
                            <div class="p-img-box">
                                <a href="@Url.Action("FestivalDetail", "Home", new { VoteShowId = VotesShows.Id, canVoteType = VotesShows.canVoteType, page = pageTemp })">
                                    <img class="lazy list-p-icon" src="@VotesShows.ImgUrl.Replace("_source","_s")">
                                </a>

                            </div>
                            <div class="r-p-text">
                                @*<img  src="@Url.Content("~/images/p-number.png")">*@
                                <div class="p-num">
                                    <span id="@VotesShows.Id-head">@VotesShows.Identify</span>
                                </div>

                            </div>
                            <div class="p-text-box">
                                <div class="p-text p-text-text fl">
                                    <h4>@VotesShows.Name</h4>
                                    <span>票数：</span><span id="@VotesShows.Id-bottom">@VotesShows.VoteNum</span>
                                </div>
                                @if (VotesShows.canVoteType == 1)
                                {
                                    <div class="p-text dianji fr">
                                        <a id=@VotesShows.Id onclick="toupiao(this)">投票</a>
                                    </div>
                                }
                                else if (VotesShows.canVoteType == 0)
                                {
                                    <div class="p-text fr">
                                        <a class="weui-btn weui-btn_disabled weui-btn_default" style="padding: 0;pointer-events:none; background-color: #f7f7f7;  color:#afafaf; cursor:default" id=@VotesShows.Id>已投</a>
                                    </div>
                                }
                                else if (VotesShows.canVoteType == 2)
                                {
                                    <div class="p-text fr">
                                        <a class="weui-btn weui-btn_disabled weui-btn_default" style="padding: 0;pointer-events:none;  background-color: #f7f7f7;   color:#afafaf;cursor:default" id=@VotesShows.Id>投票</a>
                                    </div>
                                }
                                else
                                {
                                    <div class="p-text fr">
                                        <a class="weui-btn weui-btn_disabled weui-btn_default" style="padding: 0;pointer-events:none;     background: #a8e9ff;    color: #795dc3;  cursor:default" id=@VotesShows.Id>投票</a>
                                    </div>
                                }
                            </div>
                        </div>
                    </li>
                }
            }

        </ul>
        <!--懒加载-->
        <div style="width: 100%;">
            <div class="weui-loadmore">
                <i class="weui-loading"></i>
                <span class="weui-loadmore__tips">正在加载</span>
            </div>
        </div>
    </div>


    <!--footer菜单-->
    <ul class="footer-menu">
        <li><a href="/Home/Votes">参赛节目</a></li>
        <li><a href="/Home/Regulation">赛事规则</a></li>
        <li><a href="http://m.gxanr.com">爱农人商城</a></li>
    </ul>
    <script>
        $(function () {
            FastClick.attach(document.body);
        });
        $(function(){
            //当滚动条的位置处于距顶部100像素以下时，跳转链接出现，否则消失
            $(window).scroll(function(){
                if ($(window).scrollTop()>300){
                    $(".footer-top").fadeIn(200);
                }
                else
                {
                    $(".footer-top").fadeOut(200);
                }
            });

            //当点击跳转链接后，回到页面顶部位置
            $(".footer-top").click(function () {
                $('body,html').animate({scrollTop:0},500);
                return false;
            });

            
            changeLink();

            //初始化位置
            var scrollNum = parseFloat($("#scrollNum").val());
            $(document).scrollTop(scrollNum - 100);

            var isSubscribe = $("#isSubscribe").val();
            if (!isSubscribe) {
                $(".ewm").show();//未关注公众号
            }

        });

        function changeLink() {
            //修改链接
            $("#list li").each(function () {
                var href = $(this).find(".player-list .p-img-box a");
                var hrefTop = href.offset().top;;
                var hrefValue = href.attr("href");
                href.attr("href", hrefValue + "&scrollNum=" + hrefTop);
            })
        }
    </script>
    <script src="@Url.Content("~/Scripts/jquery-weui.min.js")"></script>
    <script src="@Url.Content("~/Scripts/swiper.min.js")"></script>
    <script src="@Url.Content("~/Scripts/fastclick.js")"></script>

    <script>
        var loading = false;
        var pageIndex = parseInt($("#page").val());
        //分页滚动
        $(document.body).infinite().on("infinite", function () {
            if (loading) {
                $(".weui-loadmore").hide();
                return false;

            } else {
                loading = true;
                pageIndex++;
                $(".weui-loadmore").show();
                getdatavoteajax()
            }
        });
        function getdatavoteajax() {
            //var votenumberId = $('.clckClass').attr("votenumberid");
            if (searchtype) return false;
            var votenumberId = '@VoteNumberId';
            $.getJSON("/Home/PageList", { PageIndex: pageIndex, VoteNumberId: votenumberId }, function (data) {
                if (data.CurrentPage == -1) {
                    confirmHtml("没有更多节目了", 1, true);
                    return;
                }
                var html = "";
                var htmlResult = "";
                var htmlTemp = "";
                var loadSting = "";
                var htmlHead = "<ul class='player' id='list'>";
                var htmlEnd = "</ul>";
                $.each(data.VoteModel, function (i, item) {
                        if (item.canVoteType == 1) {
                            htmlTemp = "<div class='p-text fr'><a id=" + item.Id + " onclick='toupiao(this)'>投票</a></div>"

                        }
                        else if (item.canVoteType == 0) {
                            htmlTemp = "<div class='p-text fr' ><a class='weui-btn weui-btn_disabled weui-btn_default' style='padding:0;" +
                                     "pointer-events:none;  background-color: #f7f7f7;  color:#afafaf;  cursor:default;    margin-top: 0.5rem;'" +
                                      item.Id + ">已投</a></div>";
                        }
                        else if (item.canVoteType == 2) {
                            htmlTemp = "<div class='p-text fr' ><a class='weui-btn weui-btn_disabled weui-btn_default' " +
                                     "style='padding: 0;pointer-events:none;  background-color: #f7f7f7; color:#afafaf;    margin-top: 0.5rem;  cursor:default' id=" + item.Id +
                                     ">投票</a></div>";
                        }
                        else {
                            htmlTemp = "<div class='p-text fr' ><a class='weui-btn weui-btn_disabled weui-btn_default' " +
                                     "style='padding: 0;pointer-events:none;   background: #a8e9ff;    color: #795dc3;    margin-top: 0.5rem;  cursor:default' id=" + item.Id +
                                     ">投票</a></div>";
                        }
                    html = "<li><div class=' player-list fl'><div class='p-img-box'>" +
                          "<a href=/Home/FestivalDetail?VoteShowId=" + item.Id + "&&canVoteType=" + item.canVoteType + "&&page=" + pageIndex + ">" +
                          "<img class='lazy list-p-icon' src='" + item.ImgUrl.replace("_source", "_s") + "'></a></div>" +
                          "<div class='r-p-text'><div class='p-num'><span id='" +
                            item.Id + "-head'>" + item.Identify + "</span></div></div>" +
                    "<div class='p-text-box'><div class='p-text p-text-text fl'>" +
                    "<h4>" + item.Name + "</h4>" +
                    "<span>票数：</span><span id='" + item.Id + "-bottom'>" + item.VoteNum + "</span></div>" + htmlTemp;
                    htmlResult = htmlResult + html;
                })
                $(".player").append(htmlResult);

                changeLink();

                loading = false;
            })

        }

        $(".swiper-container").swiper({
            loop: true,
            autoplay: 3000,
            pagination: '.swiper-pagination',
        });
        //分享
        function shareBg() {
            $(".share-bg").show();
        }
        $(".share-bg").click(function () {
            $(this).hide();
        })
        //场次切换
        //$(function () {
        //    $('.nav-box li a').bind('click', function () {
        //        var loading = TipsBox("", "loading", 60, true);
        //        var votenumberId = $(this).attr("votenumberid");
        //        var ss = $(this).text();
        //        $.post("/Home/VoteSwitch", { VoteNumberId: votenumberId }, function (data) {
        //            if (loading != null) {
        //                loading.close();
        //            }
        //            if (votenumberId == -1) {
        //                $(".VoteTime").css({ display: "none" });
        //            }
        //            else {
        //                $(".VoteTime-Start").html(data.StartTime);
        //                $(".VoteTime-End").html(data.EndTime);
        //                $("#changCi").html(ss);
        //                $("#remainVotes").text(data.RemainVotes);
        //                $(".VoteTime").show();
        //            }
        //            var html = "";
        //            var htmlResult = "";
        //            var htmlTemp = "";
        //            var loadSting = "";
        //            var htmlHead = "<ul class='player' id='list'>";
        //            var htmlEnd = "</ul>";
        //            $.each(data.VoteModel, function (i, item) {
        //                if (votenumberId == -1) {
        //                    htmlTemp = "<div class='p-text fr'><a id=" + item.Id + " onclick='shareBg()'>分享</a></div>"
        //                }
        //                else {
        //                    if (item.canVoteType == 1) {
        //                        htmlTemp = "<div class='p-text fr'><a id=" + item.Id + " onclick='toupiao(this)'>投票</a></div>"

        //                    }
        //                    else if (item.canVoteType == 0) {
        //                        htmlTemp = "<div class='p-text fr' ><a class='weui-btn weui-btn_disabled weui-btn_default' style='padding:0;" +
        //                                 "pointer-events:none;  color:#afafaf;  cursor:default;    margin-top: 0.5rem;'" +
        //                                  item.Id + ">已投</a></div>";
        //                    }
        //                    //else if (item.canVoteType == 2) {
        //                    //    htmlTemp = "<div class='p-text fr' ><a class='weui-btn weui-btn_disabled weui-btn_default' " +
        //                    //             "style='padding: 0;pointer-events:none;  color:#afafaf;    margin-top: 0.5rem;  cursor:default' id=" + item.Id +
        //                    //             ">投票</a></div>";
        //                    //}
        //                    else {
        //                        htmlTemp = "<div class='p-text fr' ><a class='weui-btn weui-btn_disabled weui-btn_default' " +
        //                                 "style='padding: 0;pointer-events:none;  color:#afafaf;    margin-top: 0.5rem;  cursor:default' id=" + item.Id +
        //                                 ">投票</a></div>";
        //                    }
        //                }
        //                html = "<li><div class=' player-list fl'><div class='p-img-box'>" +
        //                      "<a href=/Home/FestivalDetail?VoteShowId=" + item.Id + "&&canVoteType=" + item.canVoteType + ">" +
        //                      "<img class='lazy list-p-icon' src='" + item.ImgUrl.replace("_source", "_s") + "'></a></div>" +
        //                      "<div class='r-p-text'><div class='p-num'><span id='" +
        //                        item.Id + "-head'>" + item.Identify + "</span></div></div>" +
        //                "<div class='p-text-box'><div class='p-text p-text-text fl'>" +
        //                "<h4>" + item.Name + "</h4>" +
        //                "<span>票数：</span><span id='" + item.Id + "-bottom'>" + item.VoteNum + "</span></div>" + htmlTemp;
        //                htmlResult = htmlResult + html;
        //            })
        //            $(".player-box").html(htmlHead + htmlResult + htmlEnd);
        //        })
                
        //    })   
        //})
    </script>
    <!--弹框-->
    <script>
    //弹框 LeaveVoteNum 0为跳转到微商城 1是不跳转直接取消
    function confirmHtml(text, LeaveVoteNum, flage) {
        var htmlDemp = '';
        var htmlBody = '';
        //单选、多选样式判断
        if (!flage) {
            htmlDemp = ' <div class=" ding-hui  fl" style="margin-left:0.5rem;background:#795dc3;color:#fff;" onclick="CancelConfirm(this)">'
                        + ' 取消'
                        + '</div>';
            htmlBody = '<div class="footer-tan">'
                        + ' <div class=" ding-hui fl" style="color:#795dc3;"onclick="SkipConfirm(this)" LeaveVoteNum=' + LeaveVoteNum + '>'
                        + ' 确定'
                        + '</div>' + htmlDemp
                       + '</div>';
        }
        else {
            htmlBody = '<div class="footer-tan">'
                        + ' <div class=" ding-hui fl" style="color:#fff;margin-left:27%;background:#795dc3;"onclick="SkipConfirm(this)" LeaveVoteNum=' + LeaveVoteNum + '>'
                        + ' 确定'
                        + '</div>' + htmlDemp
                       + '</div>';
        }
        var html = '<div class="tan">'
              + '<div class="tan-bg">'
                  + '<div class="tan-box">'
                     + '<h3>'
                        + '<a  onclick="CancelConfirm(this)" LeaveVoteNum=' + LeaveVoteNum + '>'
                            + text
                        + '</a>'
                     + '</h3>' + htmlBody
                  + '</div>'
              + ' </div>'
             + ' </div> ';
        $('body').append(html);
        $(".tan").show();
    }
    //弹框,确认跳转到微商城
    function SkipConfirm(obj) {
        $(".tan").hide();
        var LeaveVoteNum = $(obj).attr("LeaveVoteNum");
        if (LeaveVoteNum == 0) {
            window.location.href = "http://m.gxanr.com/?status=1";
        }
    }
    //取消
    function CancelConfirm(obj) {
        $(".tan").hide();
    }

    //懒加载
    $(function () {
        $("img.lazy").lazyload({ effect: "fadeIn" });
    });

    //投票
    function toupiao(obj) {
        $(".weui-dialog__btn").click(function () {
            var LeaveVoteNum = $(obj).attr("LeaveVoteNum");
            $(".weui-mask,.weui-dialog").hide();
            if (LeaveVoteNum == 0) {
                window.location.href = "http://m.gxanr.com";
            }
        })

        var showIds = $(obj).attr("id");
        var ancestors = $(obj).parent().parent().parent();
        //setTimeout(function () {
            voteByAjax(showIds, ancestors);
        //}, 500);

    }
    //投票请求
    function voteByAjax(showIds, ancestors) {
        $.ajax({
            type: "post",
            url: '@Url.Action("VoteByUser","Home")',
            data: { showId: showIds },
            async: false,
            beforeSend: function (XMLHttpRequest){

            },
            success: function (result) {
                if (isNaN(result.returnUrl)) {
                    if (result.returnUrl == "code") {
                        $(".ewm").show();//未关注公众号
                    }
                    else {
                        window.location.href = result.returnUrl; //重定向
                    }
                } else {
                    if (result.VoteNum == 0) {
                        confirmHtml("今天已经投过了这个节目", 1, true);
                    }
                    else if (result.VoteNum == -2) {
                        var txt = "今天的投票已经用完";
                        //投票已经用完
                        confirmHtml(txt, 1, true);
                    }
                    else {
                        //投票成功
                        //$(this).html("已投");
                        ancestors.find("#" + showIds + "-bottom").text(result.VoteNum);
                        ancestors.find("#" + showIds).addClass("weui-btn weui-btn_disabled weui-btn_default");
                        ancestors.find("#" + showIds).removeAttr("onclick");
                        ancestors.find("#" + showIds).html("已投");
                        if (result.result != null) {
                            //var Message = "第一次投票，赠送" + result.result.Body + "优惠券";
                            var Message = "投票成功,赠送爱农人优惠券";
                            confirmHtml(Message, 1, true);
                        }
                        if (result.LeaveVoteNum == 0) {
                            //sessionStorage.setItem("LeaveVoteNum", result.LeaveVoteNum);
                            //sessionStorage.setItem("VoteNumSession", result.VoteNum);
                            //sessionStorage.setItem("VoteNumSessionIds", showIds);
                            var txt = "今天的投票已经用完，您可以前往爱农人商城使用您的优惠券";
                            $("#remainVotes").text(result.LeaveVoteNum);
                            confirmHtml(txt, 0, false);
                            return;
                        }
                        $("#remainVotes").text(result.LeaveVoteNum);
                    }
                }
            }
        });
    }
    //搜索
    function submitSearch(FestivalName) {
        //var VoteNumberId = $(".clckClass").attr("votenumberid");
        searchtype = 1;
        var VoteNumberId = '@VoteNumberId';
        var FestNameTemp = document.getElementById(FestivalName).value;
        if (FestNameTemp == "") {
            return;
        }
        if (FestNameTemp != null && FestNameTemp != "") {
            var loading = TipsBox("", "loading", 60, true);
            $.post("/Home/SearchFestival", { FestName: FestNameTemp, VoteNumberId: VoteNumberId }, function (data) {
                if (loading != null) {
                    loading.close();
                }
                var html = "";
                var htmlResult = "";
                var htmlTemp = "";
                var loadSting = "";
                var htmlHead = "<ul class='player' id='list'>";
                var htmlEnd = "</ul>";
                $.each(data, function (i, item) {
                    if (item.canVoteType == 1) {
                        htmlTemp = "<div class='p-text dianji fr'><a id=" + item.Id + " onclick='toupiao(this)'>投票</a></div>"

                    }
                    else if (item.canVoteType == 0) {
                        htmlTemp = "<div class='p-text fr' ><a class='weui-btn weui-btn_disabled weui-btn_default' style='padding:0;" +
                                    "pointer-events:none;margin-top: 0.5rem;  color:#afafaf;  cursor:default'" +
                                    item.Id + ">已投</a></div>";
                    }
                    else {
                        htmlTemp = "<div class='p-text fr' ><a class='weui-btn weui-btn_disabled weui-btn_default' " +
                                    "style='padding: 0;pointer-events:none;  color:#afafaf; margin-top: 0.5rem; cursor:default' id=" + item.Id +
                                    ">投票</a></div>";
                    }
                    html = "<li><div class=' player-list fl'><div class='p-img-box'>" +
                           "<a href=/Home/FestivalDetail?VoteShowId=" + item.Id + "&&canVoteType=" + item.canVoteType + ">" +
                            "<img class='lazy list-p-icon' src='" + item.ImgUrl.replace("_source", "_s") + "'></a></div>" +
                            "<div class='r-p-text'><div class='p-num'><span id='" +
                            item.Id + "-head'>" + item.Identify + "</span></div></div>" +
                            "<div class='p-text-box'><div class='p-text p-text-text fl'>" +
                            "<h4>" + item.Name + "</h4>" +
                            "<span>票数：</span><span id='" + item.Id + "-bottom'>" + item.VoteNum + "</span></div>" + htmlTemp;
                    htmlResult = htmlResult + html;
                })
                if (htmlResult != "") {
                    $(".player-box").html(htmlHead + htmlResult + htmlEnd);
                }
                else {
                    $(".player-box").html("<p style='text-align: center !important;padding-top:0.5rem;'>没有找到该项节目...</p>");
                }
            })
        }
    }
    //回车搜索
    function serkeydown(a, e) {
        var ev = document.all ? window.event : e;
        if (ev.keyCode == 13) {
            return submitSearch('FestivalName');
        }
    }
    function serkeydown1(a, e) {
        var ev = document.all ? window.event : e;
        if (ev.keyCode == 13) {
            return submitSearch('FestivalName1');
        }
    }
    $(".nav-box li a").bind("click", function () {
        $(".clckClass").removeClass("clckClass");
        $(this).addClass("clckClass");
        pageIndex = 1;
    });
    $(document).ready(function () {
        $(".moren").click(function () {
            $(".VoteTime-text").show();
        });
        $(".close").click(function () {
            $(".ewm").hide();
        });
    });

    </script>

    <script src="http://res.wx.qq.com/open/js/jweixin-1.2.0.js"></script>
    <script>
        // jssdk config 对象
        var jssdkconfig;
        $(function () {
            $.ajax({
                type: "get",
                url: "http://m.gxanr.com/anrweixin/voteshare.php?do=jssdk&ajax=1&acid=2&ajaxurl=" + encodeURIComponent(location.href),
                dataType: "jsonp",
                success: function (ret) {
                    if (ret.appId) {
                        jssdkconfig = ret;
                        // 是否启用调试
                        jssdkconfig.debug = false;
                        jssdkconfig.jsApiList = [
                            'checkJsApi',
                            'onMenuShareTimeline',
                            'onMenuShareAppMessage',
                            'onMenuShareQQ',
                            'onMenuShareWeibo',

                        ];
                        wx.config(jssdkconfig);
                    }
                }
            });
        });




        //alert(JSON.stringify(jssdkconfig))
        var sharedata = { "desc": "投票即可获得0.1元购买五常大米一斤，先到先得，快来点我吧", "title": "爱农人2017柳州“童心 同乐”六一少儿艺术展演", "imgUrl": "http://vote.gxanr.com/content/img/share.png", "link": "http://vote.gxanr.com" };

        wx.ready(function () {
            wx.onMenuShareAppMessage(sharedata);
            wx.onMenuShareTimeline(sharedata);
            wx.onMenuShareQQ(sharedata);
            wx.onMenuShareWeibo(sharedata);
        });
    </script>


</body>
</html>
